// miscelaneous.cpp

#include "auxlib.h"
#include <iostream>
using namespace std;
#include "miscelaneous.h"


void loop_test() {
	cout << "=== loop_test" << endl;
	MyClock clk;
	double duration_sec;
	clk.markTime();
	// code to test begin
	int size = 100000;
	for (int i=0; i<size; i++)
		for (int j=0; j<size; j++)
			/* do nothing */ ;
	// code to test end
	duration_sec = clk.getDiffTime();
	cout << "duration=" << duration_sec << " sec" << endl;
}

void assert_float_point() {
	cout << "=== assert_float_point" << endl;
	double eps = 1e-8;
	myAssert(1+1==2);
	myAssert(3.3!=1.1+2.2);
	myAssert(nearEqual(3.3,1.1+2.2,eps));
}

